package com.hry.store.Interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConf implements WebMvcConfigurer {
    @Autowired
    private SettleAccountInterceptor settleAccountInterceptor;

    /**
     * 拦截没有登录的请求
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(settleAccountInterceptor)
                .addPathPatterns("/cart/jiesuan")
                // 拦截用户个人信息
                .addPathPatterns("/user/selfInfo")
//                // 拦截购物车订单
//                .addPathPatterns("/cart/order")
                // 确认订单
//                .addPathPatterns("/order/confirmOrder")
                // 拦截删除收货地址
                .addPathPatterns("/shipping/deleteShipping");


    }
}
